﻿@using JinRi.WebHost.ViewModels
@model JinRi.WebHost.ViewModels.BannerModel
@{
    ViewBag.Title = "招聘";
    var jobs = ViewBag.Jobs as List<JobModel>;
}


<div class="container clearfix">
    @if (Model.ImageId != Guid.Empty)
    {
        <div class="banner">
            <img src="@Url.Action("Get", "Image", new { id = Model.ImageId })" />
        </div>
    }
    <h2 class="title">应聘须知</h2>
    <div class="hr"></div>
    <div class="content">
        @Html.Raw(Model.Introduce)
    </div>
    <h2 class="title">职位招聘</h2>
    <div class="hr"></div>
    <ul class="tabs">
        @foreach (var job in jobs)
        {
            <li @(jobs.IndexOf(job) == 0 ? "class=active" : string.Empty)>@job.Title</li>
        }
    </ul>
    @foreach (var job in jobs)
    {
        <div class="jd @(jobs.IndexOf(job) == 0 ?"active": string.Empty)">
            @Html.Raw(job.Content)
        </div>
    }
    <div class="hr"></div>
</div>


@section scripts
{
    <script>
        $(function () {
            $('.tabs').on('click', 'li', function () {
                var index = $(this).index();
                $(".jd").removeClass('active');
                $('.jd:eq(' + index + ')').addClass('active');
            });

        });
    </script>
}